class Employee::PositionsController < InheritedResources::Base
  respond_to :json
  load_resource
  
  def index
    employee_positions = Employee::Position.paginate(:page => params[:page])
    respond_with EmployeePositionJsonSerializer.index_json employee_positions
  end

  def create
    employee_position = ::AddEmployeePosition.run permitted_params
    render CommandJsonSerializer.as_json employee_position
  end

  def show
    respond_with EmployeePositionJsonSerializer.as_json @position
  end

  def update
    @position.update permitted_params
    respond_with @position
  end

  private
  def permitted_params
    params.permit(:position_id, :employee_id, :organization_id, :induction_time, :id)
  end

end